package com.xyc.controller;

import com.xyc.entity.Student;
import com.xyc.service.StudentService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class StudentController {

    @Resource
    StudentService studentService;

    @GetMapping("/info")
    public String info(@RequestParam int sid, Model model){
        Student student = studentService.getStudent(sid);
        model.addAttribute("student",student);
        return "info";
    }
}
